(:
XQuery that gets complex types from xsd
:)

declare namespace ns = "http://www.w3.org/2001/XMLSchema";
<xsd-complex>{
let $doc := doc("xsd.xsd")

for $types in $doc//ns:complexType
let $name := $types/@name
return

   <complexType name="{$name}"></complexType>
}</xsd-complex>